package chapter03

object MapTest extends App {

  val map = scala.collection.mutable.Map(1 -> "a", 2 -> "b", 3 -> "c")

  println(map.size)
  println(map(2))
  val v = map.getOrElse(4, "d")
  println(v)

  map(1) = "Hello"

  map -= 1

  for ((k, v) <- map)
    println(k + "  " + v)

  for (k <- map.keys)
    println(k)
}